package main

import "fmt"

func main() {
	user := C011_D3_User{Name: "张三", Age: 16}
	fmt.Println(user)

	//链式调用，修改属性
	user.setAge(18).setName("李四")
	fmt.Println(user)
}

type C011_D3_User struct {
	Name string
	Age  int
}

func (user *C011_D3_User) setName(name string) *C011_D3_User {
	user.Name = name
	return user
}

func (user *C011_D3_User) setAge(age int) *C011_D3_User {
	user.Age = age
	return user
}
